﻿using System;
using System.Data;
using System.Collections.Generic;
using FiberRMS.Model.AlarmManager;
namespace FiberRMS.BLL.AlarmManager
{
    /// <summary>
    /// 业务逻辑类ALARM_EXPERIENCE 的摘要说明。
    /// </summary>
    public class ALARM_EXPERIENCE
    {
        private readonly FiberRMS.DAL.AlarmManager.ALARM_EXPERIENCE dal = new FiberRMS.DAL.AlarmManager.ALARM_EXPERIENCE();
        public ALARM_EXPERIENCE()
        { }
        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(string ALARMEXPERID)
        {
            return dal.Exists(ALARMEXPERID);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(FiberRMS.Model.AlarmManager.ALARM_EXPERIENCE model)
        {
            dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(FiberRMS.Model.AlarmManager.ALARM_EXPERIENCE model)
        {
            dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public void Delete(string ALARMEXPERID)
        {

            dal.Delete(ALARMEXPERID);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public FiberRMS.Model.AlarmManager.ALARM_EXPERIENCE GetModel(string ALARMEXPERID)
        {

            return dal.GetModel(ALARMEXPERID);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }
        /// <summary>
        /// 获得相似基站
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public DataSet getSame(string id)
        {
            return dal.getSame(id);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<FiberRMS.Model.AlarmManager.ALARM_EXPERIENCE> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            List<FiberRMS.Model.AlarmManager.ALARM_EXPERIENCE> modelList = new List<FiberRMS.Model.AlarmManager.ALARM_EXPERIENCE>();
            int rowsCount = ds.Tables[0].Rows.Count;
            if (rowsCount > 0)
            {
                FiberRMS.Model.AlarmManager.ALARM_EXPERIENCE model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new FiberRMS.Model.AlarmManager.ALARM_EXPERIENCE();
                    model.ALARMEXPERID = ds.Tables[0].Rows[n]["ALARMEXPERID"].ToString();
                    model.EQUIPMODEL = ds.Tables[0].Rows[n]["EQUIPMODEL"].ToString();
                    model.DESCRIPTION = ds.Tables[0].Rows[n]["DESCRIPTION"].ToString();
                    model.ANALYSIS = ds.Tables[0].Rows[n]["ANALYSIS"].ToString();
                    model.DISPOSEMETHOD = ds.Tables[0].Rows[n]["DISPOSEMETHOD"].ToString();
                    model.VENDOR = ds.Tables[0].Rows[n]["VENDOR"].ToString();
                    model.REMARK = ds.Tables[0].Rows[n]["REMARK"].ToString();
                    model.ALARMNUMBER = ds.Tables[0].Rows[n]["ALARMNUMBER"].ToString();
                    modelList.Add(model);
                }
            }
            return modelList;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  成员方法
    }
}

